home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Found / FWMemory / Include / FWFixMem.h next >
Encoding:
Text File  |  1995-11-08  |  1.5 KB  |  66 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWFixMem.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    (c) 1993, 1995 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWFIXMEM_H
  11. #define FWFIXMEM_H
  12.  
  13. #include <stddef.h>
  14.  
  15. #ifndef FWSTDDEF_H
  16. #include "FWStdDef.h"
  17. #endif
  18.  
  19. #if FW_LIB_EXPORT_PRAGMAS
  20. #pragma lib_export on
  21. #endif
  22.  
  23. //========================================================================================
  24. // Foreware declarations
  25. //========================================================================================
  26.  
  27. struct FW_SPrivFixedNode;
  28. struct FW_SPrivFixedBlock;
  29.  
  30. //========================================================================================
  31. // CLASS FW_CFixedAllocator
  32. //========================================================================================
  33.  
  34. class FW_CLASS_ATTR FW_CFixedAllocator
  35. {
  36. public:
  37.  
  38. // ----- Construction
  39.  
  40.                         FW_CFixedAllocator(short allocSize);
  41.                         ~FW_CFixedAllocator();
  42.  
  43. // ----- Allocation
  44.  
  45.     void*                Allocate();
  46.     void                Free(void* block);
  47.     
  48. // ----- Implementation
  49.  
  50. private:
  51.     long                fAllocCount;
  52.     short                fAllocSize;
  53.     FW_SPrivFixedNode*    fFreeList;
  54.     FW_SPrivFixedBlock*    fBlockList;
  55.  
  56.     // No copying
  57.                         FW_CFixedAllocator(const FW_CFixedAllocator& );
  58.     FW_CFixedAllocator&    operator=(const FW_CFixedAllocator& );
  59. };
  60.  
  61. #if FW_LIB_EXPORT_PRAGMAS
  62. #pragma lib_export off
  63. #endif
  64.  
  65. #endif // FWFIXMEM_H
  66.